home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-23 | 1.1 KB | 64 lines | [TEXT/PJMM] |
- unit DoMenus;
- { DeHQX v2.0.0 © Peter Lewis, Aug 1991 }
-
- interface
-
- uses
- MyTypes, MyUtilities, MyLists, AppGlobals, MyFileSystem, MyMenus, MyMainLoop, Preferences;
-
- procedure InitMenus (dodehqx: ptr);
- procedure SetMenus;
- procedure DoMenu (m, i: integer);
-
- implementation
-
- var
- dodehqxp: ptr;
-
- procedure CallProc (p: ptr);
- inline
- $205F, $4E90;
-
- procedure DoMenu (m, i: integer);
- begin
- if SimpleDoMenu(m, i) then
- case m of
- M_File:
- case i of
- M_Preferences:
- OpenPreferences;
- M_Close:
- if (FrontWindow = prefs_dialog) and (prefs_dialog <> nil) then
- ClosePreferences;
- M_DeHQX:
- CallProc(dodehqxp);
- M_Quit:
- quitNow := true;
- otherwise
- ;
- end;
- otherwise
- ;
- end;
- if not quitNow then
- HiliteMenu(0);
- end;
-
- procedure SetMenus;
- var
- fw: windowPtr;
- begin
- SimpleSetMenus;
- fw := FrontWindow;
- SetItemEnable(GetMenu(M_File), M_Preferences, (fw = nil) or (fw <> prefs_dialog));
- end;
-
- procedure InitMenus (dodehqx: ptr);
- begin
- dodehqxp := dodehqx;
- SimpleInitMenus(M_Help, M_Close, GetGlobalString(help_menu_text));
- SetMenus;
- DrawMenuBar;
- end;
-
- end.